package com.zmn.oms.third.yunding.service;

import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.entity.work.OrderWorkLogChange;
import com.zmn.oms.third.yunding.api.YundingOrderCacheData;
import com.zmn.oms.third.yunding.dto.YundingCancelOrderDTO;
import com.zmn.oms.third.yunding.dto.YundingCreateOrderDTO;
import com.zmn.oms.third.yunding.dto.YundingOldPartSendbackDTO;

/**
 * 云丁鹿客渠道对接的接口定义类
 *
 * @author xiewenbing
 * @date  2020/09/08 19:00
 */

public interface YundingService {

    /**
     * 创建订单
     *
     * @param createOrderDTO
     * @return 订单Id
     * @throws OmsBaseException
     */
    String createOrder(YundingCreateOrderDTO createOrderDTO) throws OmsBaseException;

    /**
     * 取消订单
     * @param cancelOrderDTO
     * @throws OmsBaseException
     */
    void cancelOrder(YundingCancelOrderDTO cancelOrderDTO) throws OmsBaseException;

    /**
     * 同步渠道订单确认
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderConfirm(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步订单预约时间
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderDutytime(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步订单派单
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderDistribute(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步师傅上门时间
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderMasterVisit(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步订单取消
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderCancel(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步订单服务完成
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderServiceComplete(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 同步订单完成 - 空跑状态
     * @param orderWorkLogChange
     * @throws OmsBaseException
     */
    void syncOrderComplete(OrderWorkLogChange orderWorkLogChange) throws OmsBaseException;

    /**
     * 查找云丁渠道订单的资料 - dubbo接口实现
     *
      * @param orderId
     * @return
     * @throws OmsBaseException
     */
    YundingOrderCacheData getOrderShowData(Long orderId) throws OmsBaseException;

    /**
     * 保存填写的云丁渠道订单的相关资料 - dubbo接口实现
     *
     * @param yundingOrderCacheData
     * @throws OmsBaseException
     */
    void saveOrderShowData(Long orderId, YundingOrderCacheData yundingOrderCacheData) throws OmsBaseException;

    /**
     * 同步旧件回寄 - dubbo接口实现
     *
     * @param oldPartSendbackDTO
     * @throws OmsBaseException
     */
    void syncOldPartSendBack(YundingOldPartSendbackDTO oldPartSendbackDTO) throws OmsBaseException;

    /**
     * 验证并同步订单完成数据
     *
     * @param orderId
     * @throws OmsBaseException
     */
    void verifyCompleteOrder(Long orderId, Long workId) throws OmsBaseException;
}
